package com.sh.data.engine.application.model.request.integration;

import com.sh.data.engine.domain.base.model.entity.TbTaskFieldMapEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author tinglan.ys
 * @description:
 * @date 2022/3/17 下午4:57
 */
@Data
@Schema
public class SaveTaskWithFromTextRequest {

    /**
     * 表Id
     */
    @Schema(description = "表Id")
    private Long tblId;

    /**
     * 表名
     */
    @Schema(description = "表名")
    private String tableName;

    @Schema(description = "文件名")
    private String fileName;

    @Schema(description = "文件在服务器的地址")
    private String filePath;

    @Schema(description = "文件下载地址")
    private String fileDownloadPath;

    /**
     * 数据替换规则 1-清除 2-插入
     */
    @Schema(description = "数据替换规则 1-清除 2-插入")
    @NotNull(message = "数据替换规则不能为空")
    private Integer dataReplaceRuleId;

    /**
     * 跳过的行数 默认为1
     */
    @Schema(description = "跳过的行数 默认为1")
    private Integer skipCount = 1;

    /**
     * 字段关系映射
     */
    @Schema(description = "字段关系映射")
    @NotEmpty(message = "字段关系映射不能为空，请配置后重试")
    private List<TbTaskFieldMapEntity> tbTaskFieldMapEntities;


    /**
     * encodeFormat
     */
    @Schema(description = "编码格式(仅针对csv格式文件有效)", allowableValues = {"GBK", "UTF-8"})
    //@NotBlank(message = "编码格式(仅针对csv格式文件有效)不能为空")
    private String encodeFormat;

}
